<?php

/**
 * Generated Model class.
 */
class Base_SpamDetectedPeer extends Db_Peer implements ISingleton
{

    const ID = '`spam_detected`.`id`';

    const GROUP_ID = '`spam_detected`.`group_id`';

    const POST_ID = '`spam_detected`.`post_id`';

    const POST_URL = '`spam_detected`.`post_url`';

    const TEXT = '`spam_detected`.`text`';

    const TIMESTAMP = '`spam_detected`.`timestamp`';

    protected $_name = 'spam_detected';

    protected $_rowClass = 'SpamDetectedRow';

    protected $_dependentTables = array();

    protected $_referenceMap = array();

    private static $_instance = null;

    protected $_metadata = array(
        'id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'spam_detected',
            'COLUMN_NAME' => 'id',
            'COLUMN_POSITION' => 1,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => true,
            'PRIMARY_POSITION' => 1,
            'IDENTITY' => true
            ),
        'group_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'spam_detected',
            'COLUMN_NAME' => 'group_id',
            'COLUMN_POSITION' => 2,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'post_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'spam_detected',
            'COLUMN_NAME' => 'post_id',
            'COLUMN_POSITION' => 3,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '155',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'post_url' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'spam_detected',
            'COLUMN_NAME' => 'post_url',
            'COLUMN_POSITION' => 4,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '255',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'text' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'spam_detected',
            'COLUMN_NAME' => 'text',
            'COLUMN_POSITION' => 5,
            'DATA_TYPE' => 'text',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'timestamp' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'spam_detected',
            'COLUMN_NAME' => 'timestamp',
            'COLUMN_POSITION' => 6,
            'DATA_TYPE' => 'timestamp',
            'DEFAULT' => 'CURRENT_TIMESTAMP',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            )
        );

    /**
     * @return SpamDetectedPeer
     */
    public static function getInstance()
    {
        if (!self::$_instance) {
        	self::$_instance = new SpamDetectedPeer();
        }
        return self::$_instance;
    }

    /**
     * @return Db_Rowset
     */
    public function findById($id)
    {
        $select = $this->select();
        $select->where('`id` = ?', $id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByGroupId($group_id)
    {
        $select = $this->select();
        $select->where('`group_id` = ?', $group_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPostId($post_id)
    {
        $select = $this->select();
        $select->where('`post_id` = ?', $post_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPostUrl($post_url)
    {
        $select = $this->select();
        $select->where('`post_url` = ?', $post_url);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByText($text)
    {
        $select = $this->select();
        $select->where('`text` = ?', $text);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByTimestamp($timestamp)
    {
        $select = $this->select();
        $select->where('`timestamp` = ?', $timestamp);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }


}

